package com.common.listener;



import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

import com.common.log.LogAspect;

/**
 * application 生命周期监听
 * @author YYQ
 *
 */
public class MyServletContextListener implements ServletContextListener {

	private final Logger logger = Logger.getLogger(MyServletContextListener.class);

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		logger.info("===================> 系统已启动");
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		logger.info("===================> 系统已销毁");
		// 操作日志线程释放
		while(LogAspect.getQueue().size() == 0) {
			LogAspect.setRun(false);
			break;
		}
	}
	
	
}
